<template>
	<view class="systemInfoList">
		<view class="list" v-for="(item,i) in msg" :key='i' @tap="toinfo(item)">
			<view class="time">{{item.create_time}}</view>
			<view class="info">
				<view class="typeInfo">{{item.title}}</view>
				<view class="content scale-1px-bottom line3" v-html="item.content"></view>
				<view class="next word" >立即查看</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				msg:[],
				ip:'',
			}
		},
		onLoad(option) {
			this.ip=option.ip
			this.getmsg(option.ip)
		},
		onShow() {
		},
		methods: {
			getmsg() {
				this.http(this.ip, 'post', {}).then(res => {
					if (res.sta == 200) {
						this.msg = res.data.data
						console.log(this.msg)
						uni.setStorageSync('msgnum',this.msg.length)
					}
				})
			},
			toinfo(v){
				// let m=JSON.stringify(v)
				// uni.navigateTo({
				//     url: '/pages/index/system/systemInfoDetail?id='+m
				// });
				if(this.ip=='/api/sys_msg/index'){
				this.getnav(this.router(`systemInfoDetail?id=${v.id}&ip=/api/sys_msg/read`));	
				}else{
				this.getnav(this.router(`systemInfoDetail?id=${v.id}&ip=/api/user_msg/read`));
				}
				
			}
		}
	}
</script>

<style lang="less">
	page {
		background-color: #F5F5F9;
	}

	.systemInfoList {
		padding: 0 40rpx;

		.list {
			.time {
				color: rgba(206, 211, 221, 1);
				text-align: center;
				padding-top: 40rpx;
			}

			.info {
				margin-top: 26rpx;
				width: 100%;
				background: rgba(255, 255, 255, 1);
				box-shadow: 0px 0px 10rpx 0px rgba(0, 0, 0, 0.1);
				border-radius: 20rpx;
				padding: 30rpx;

				.typeInfo {
					font-weight: bold;
				}

				.content {
					padding: 30rpx 0;
					font-size: 24rpx;
					color: rgba(206, 211, 221, 1);
				}

				.word {
					font-weight: 500;
					color: rgba(34, 145, 255, 1);
					margin-top: 30rpx;
				}
			}
		}
	}
</style>
